package com.sunshine.ssm.multithreading;

/**
 * @Author: WeiHong
 * @Date: 2017/5/17 16:27
 */
public class Account {

    private double balance;  //账户余额

    public void deposit(double money){
        double newBlanace = this.balance + money;
        try {
            //模拟业务操作需要10秒钟
            Thread.sleep(10);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        this.balance = newBlanace;
    }

    public double getBalance() {
        return balance;
    }

}
